package org.dromara.business.modules.demands.domain.vo;

import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.business.modules.demands.domain.BuDemands;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.sensitive.annotation.Sensitive;
import org.dromara.common.sensitive.core.SensitiveStrategy;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * 需求信息视图对象 bu_demands
 *
 * @author ckk
 * @date 2025-10-20
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = BuDemands.class)
public class BuDemandsVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 需求ID
     */
    @ExcelProperty(value = "需求ID")
    private Long id;

    /**
     * 需求标题
     */
    @ExcelProperty(value = "需求标题")
    private String title;

    /**
     * 需求分类ID
     */
    @ExcelProperty(value = "需求分类ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "xqfl")
    private Long categoryId;

    /**
     * 需求分类标签
     */
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "categoryId", other = "xqfl")
    private String categoryLabel;

    /**
     * 需求简介（一句话）
     */
    @ExcelProperty(value = "需求简介", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "一=句话")
    private String intro;

    /**
     * 需求详细内容
     */
    @ExcelProperty(value = "需求详细内容")
    private String content;

    /**
     * 最低预算
     */
    @ExcelProperty(value = "最低预算")
    private BigDecimal budgetMin;

    /**
     * 最高预算
     */
    @ExcelProperty(value = "最高预算")
    private BigDecimal budgetMax;

    /**
     * 预算是否面议：0-否，1-是
     */
    @ExcelProperty(value = "预算是否面议：0-否，1-是")
    private Integer budgetNegotiable;

    /**
     * 需求地区
     */
    @ExcelProperty(value = "需求地区")
    private String location;

    /**
     * 需求时效
     */
    @ExcelProperty(value = "需求时效", converter = ExcelDictConvert.class)
    @ExcelDictFormat(dictType = "xqsx")
    private String urgency;

    /**
     * 需求时效标签
     */
    @Translation(type = TransConstant.DICT_TYPE_TO_LABEL, mapper = "urgency", other = "xqsx")
    private String urgencyLabel;

    /**
     * 联系人姓名
     */
    @ExcelProperty(value = "联系人姓名")
    @Sensitive(strategy = SensitiveStrategy.CHINESE_NAME, roleKey = "admin")
    private String contactName;

    /**
     * 联系电话
     */
    @ExcelProperty(value = "联系电话")
    @Sensitive(strategy = SensitiveStrategy.PHONE, roleKey = "admin")
    private String contactPhone;

    /**
     * 状态：0-已发布，1-待审核，2-已下架，3-已完成，4-已取消
     */
    @ExcelProperty(value = "状态：0-已发布，1-待审核，2-已下架，3-已完成，4-已取消")
    private Integer status;

    /**
     * 浏览次数
     */
    @ExcelProperty(value = "浏览次数")
    private Integer viewCount;

    /**
     * 回复次数
     */
    @ExcelProperty(value = "回复次数")
    private Integer replyCount;

    /**
     * 过期时间
     */
    @ExcelProperty(value = "过期时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date expireTime;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;

    /**
     * 驳回原因
     */
    private String reason;

}
